﻿using System;

namespace TheSnake
{
    public abstract class MovingObject : GameObject
    {
        public MatrixCoords Speed { get; protected set; }

        protected MovingObject(MatrixCoords topLeft, char[,] body, MatrixCoords speed)
            : base(topLeft, body)
        {
            this.Speed = speed;
        }

        protected MovingObject(MatrixCoords topLeft, char [,] body)
            : base(topLeft, body)
        {            
        }

        public virtual void UpdatePosition()
        {
            this.TopLeft += this.Speed;
        }

        public override void Update()
        {
            this.UpdatePosition();
        }
    }
}
